export type MODE = "dev|test";

export interface AnyObject extends Record<string, any> {}

/** pinia中globalStore的类型 */
export interface IGlobalStoreState {
  count: number;
  /** 主页是否缓存 */
  keepAliveHome: boolean;
}

/** 咖啡配料类型 */
export interface ICoffeeDosingProps {
  /** id */
  id: string;
  /** 名称 */
  name: string;
  /** 样式 */
  styles: string;
  /** 价格 */
  price?: number;
}

/** 咖啡数据 */
export interface ICoffeeProps {
  id: string;
  sub: string;
  children: Array<ICoffeeDosingProps>;
}

/** 数组子类型推断 */
export type getArrayItemType<T extends Array<Object>> = T[0] extends infer R
  ? R
  : never;

/** 个人信息类型 */
export interface IUserInfo {
  userName: string;
  school: string;
  baseInfo: {
    address: string;
    tel: string;
    email: string;
    birthday: string;
  };
  education: Array<{
    year: string;
    schoolName: string;
    desc: string;
  }>;
}

export type innterAnotherType<T extends Object, U> = {
  [K in keyof T]: T[K] extends object ? innterAnotherType<T[K], U> : U;
};
